package org.myspring.dis;

public class Man {

	private String name;
	private int age;
	private Person spouse;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public Person getSpouse() {
		return spouse;
	}

	public void setSpouse(Person spouse) {
		this.spouse = spouse;
	}

	@Override
	public String toString() {
		StringBuffer stringBuffer = new StringBuffer(64);
		stringBuffer.append("name:" + getName());
		stringBuffer.append("\n");
		stringBuffer.append("age:" + getAge());
		stringBuffer.append("\n");
		if (spouse != null) {
			stringBuffer.append("->spouse.name:" + spouse.getName());
			stringBuffer.append("\n");
			stringBuffer.append("->spouse.age:" + spouse.getAge());
		}
		return stringBuffer.toString();
	}
}
